<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{% block title %}软件中心{% endblock %}</title>
    <style>
        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            margin: 0;
            padding: 0;
            background-color: #f4f7f6;
            color: #333;
        }
        .navbar {
            background-color: #0056b3;
            padding: 15px 30px;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .navbar .logo {
            color: white;
            font-size: 1.5em;
            font-weight: bold;
            text-decoration: none;
        }
        .navbar .nav-links a {
            color: white;
            text-decoration: none;
            margin-left: 20px;
            font-size: 1em;
            padding: 8px 15px;
            border-radius: 5px;
            transition: background-color 0.3s ease;
        }
        .navbar .nav-links a:hover, .navbar .nav-links a.active {
            background-color: #004494;
        }
        .App-container {
            max-width: 900px;
            margin: 40px auto;
            padding: 30px;
            background-color: #ffffff;
            border-radius: 10px;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
        }
        h1, h2 {
            text-align: center;
            color: #0056b3;
            margin-bottom: 25px;
            font-weight: 600;
        }
        .flash-messages {
            list-style: none;
            padding: 0;
            margin: 0 0 20px 0;
        }
        .flash-messages li {
            padding: 15px;
            border-radius: 5px;
            background-color: #d4edda;
            color: #155724;
            border: 1px solid #c3e6cb;
        }
    </style>
    {% block head %}{% endblock %}
</head>
<body>
    <nav class="navbar">
        <a href="{{ url_for('search') }}" class="logo">软件中心</a>
        <div class="nav-links">
            <a href="{{ url_for('search') }}" class="{{ 'active' if request.endpoint == 'search' else '' }}">软件下载链接查询</a>
            <a href="{{ url_for('files') }}" class="{{ 'active' if request.endpoint in ['files', 'view_file', 'edit_file'] else '' }}">文件管理</a>
            <a href="{{ url_for('commands') }}" class="{{ 'active' if request.endpoint in ['commands', 'add_command', 'edit_command'] else '' }}">命令管理</a>
        </div>
    </nav>

    <div class="App-container">
        {% with messages = get_flashed_messages() %}
          {% if messages %}
            <ul class="flash-messages">
            {% for message in messages %}
              <li>{{ message }}</li>
            {% endfor %}
            </ul>
          {% endif %}
        {% endwith %}
        {% block content %}{% endblock %}
    </div>

    {% block scripts %}{% endblock %}
</body>
</html>